package com.itHsuSE.demo8;

import javax.swing.*;
import java.awt.*;

/**
 * @author Hsu琛君珩
 * @ClassName:Test5
 * @date 2023-12-19
 * @apiNote
 * @Version: v1.0
 */

public class Test5 {
    public static void main(String[] args) {
        JFrame jf = new JFrame("Frame");
        jf.setLayout((new FlowLayout()));
        jf.setBounds(400, 300, 300, 400);

        JRadioButton jrb1=new JRadioButton("男");
        JRadioButton jrb2=new JRadioButton("女");
        ButtonGroup group=new ButtonGroup();
        group.add(jrb1);
        group.add(jrb2);
        jf.add(jrb1);
        jf.add(jrb2);

        JCheckBox jcb1=new JCheckBox("睡觉",true);
        JCheckBox jcb2=new JCheckBox("写代码",false);
        JCheckBox jcb3=new JCheckBox("打游戏",false);
        jf.add(jcb1);
        jf.add(jcb2);
        jf.add(jcb3);

        jf.setVisible(true);
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
}
